﻿/*----------------------------------------------------------------------------------------
*
*  Copyright 2019, Gao Hai Hui, <fromzeropoint@126.com>.  All rights reserved.
*  https://gitee.com/helloworldghh/xoskit.git
*  Use of this source code is governed by a MIT license
*  that can be found in the License file.
*
----------------------------------------------------------------------------------------*/
#include "../import/head.h"
#include "../impl/head.h"
#include "sys_data.h"

///////////////////////////////////////////////////////////////////////////////////////////////////

namespace xos_curl
{

    sys_data::sys_data( xos_container::i_container * pContainer ) : m_pContainer( pContainer )
    {
        m_pTime = 0;
    }

    sys_data::~sys_data()
    {
    }

    int sys_data::init()
    {
        int nRet = 0;

        if( 0 == nRet )
        {
            nRet = m_pContainer->xos()->create(xos::i_xos::XOS_OBJ_TIME, ( void ** )&m_pTime);
        }

		if( 0 == nRet )
		{
			nRet = curl_impl::init_all();
		}

        return nRet;
    }

    int sys_data::term()
    {
        using namespace std;

        int nRet = 0;

        curl_impl::term_all();

		xos_stl::release_interface( m_pTime );

        return nRet;
    }

} // xos_curl
